package com.chushouya.common.constant;

import com.general.framework.core.enums.IEnum;

import java.util.Objects;

/**
 * 活动状态枚举
 */
public enum ActivityStatusEnum implements IEnum<Integer> {

    UNUSED(1, "未使用"),
    USED(2, "已使用");

    private final Integer value;

    private final String name;

    ActivityStatusEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    @Override
    public Integer value() {
        return this.value;
    }

    @Override
    public String named() {
        return this.name;
    }

    public static String getName(Integer value) {
        for (ActivityStatusEnum thisEnum : ActivityStatusEnum.values()) {
            if (Objects.equals(thisEnum.value, value)) {
                return thisEnum.name;
            }
        }
        return "";
    }
}
